import os
import shutil

# image_path='E:\dataset_perfect\all_need_test\bike'

# image_path='E:\dataset_perfect\\all_need_test\\bike'
# base_path='E:\dataset_perfect\\all_need_test\\yolo_bike\\labels'
# new_path='E:\\dataset_perfect\\all_need_test\\yolo_bike\\images'

# image_path='E:\\dataset_perfect\\all_need_test\\upload_all\\dinetable'
# base_path='E:\\dataset_perfect\\all_need_test\\table\\labels'
# new_path='E:\\dataset_perfect\\all_need_test\\table\\images'

# image_path='E:\\dataset_perfect\\all_need_test\\upload_all\\motorbike'
# base_path='E:\\dataset_perfect\\all_need_test\\motorbike\\labels'
# new_path='E:\\dataset_perfect\\all_need_test\\motorbike\\images'

# E:\dataset_perfect\all_need_test\upload_all\car

image_path='E:\\dataset_perfect\\all_need_test\\add_new\\car_new2\\change_size_car'
base_path='E:\\dataset_perfect\\all_need_test\\add_new\\car_new2\\labels'
new_path='E:\\dataset_perfect\\all_need_test\\car2'


path_names=os.listdir(base_path)


for inner_file in path_names:
    # print(inner_file)

    # file_name=base_path+inner_file
    file_name=os.path.join(base_path,inner_file)
    # print(file_name)

    split_name=inner_file.split('.')[0]

    # 修改jpg或png格式
    image_name=image_path+'\\'+split_name+'.jpg'

    if os.path.isfile(image_name):
        # shutil.move(image_name, new_path)
        shutil.move(image_name, new_path)



    print(image_name)
    


    

